home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase Pro v7.0 / DATA1.CAB / Utilities / Upgrade / Rpttorep.prg < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.2 KB  |  135 lines

  1.  
  2. /* RptToRep.Prg - Report Converter Wizard for Visual dBASE 7
  3.  
  4.     Purpose            To convert Crystal 3.0 binary report and label files to
  5.                        Visual dBASE 7 Report Classes
  6.  
  7.    Limitations    Because of inherent incompatibilities between the workarea-
  8.                        oriented DML of Visual dBASE 5.5 and the object-oriented
  9.                   data classes in Visual dBASE 7, complex relations, filters
  10.                   and keys cannot be converted automatically. To do so would
  11.                   require a program that parses the entire dBASE language.
  12.  
  13.                   Therefore, the Report Converter Wizard will bring over
  14.                   simple single-field relations only. All other relations
  15.                   must be hand-coded by the user after conversion.
  16.  
  17.                   The Report Wizard provides error messages both onscreen
  18.                   and in the header of the target .rep file to indicate
  19.                   the areas that the Wizard was unable to convert.
  20.  
  21.    Files:            RptToRep.Prg          Main startup program for Wizard
  22.                        RptToRep.Wfm          Main user-interface program. The Wizard Form
  23.                   RptToRepConv.cc     Main conversion/streaming class
  24.                   RptToRepRsc.cc       Internationalization Resources
  25.  
  26.  
  27.   Author:            A. A. Katz (Ksoft, Inc.) and James Sare
  28.  
  29.   Version:            1.0  10/4/1997
  30.  
  31.   (c) 1997 Borland International, all rights reserved
  32.  
  33. */
  34.  
  35.    /////////////////////////////Parameters
  36.  
  37.     Param cDefaultFile  // Enables Navigator call to Wizard   
  38.    cDefaultFile = upper(iif(type('cDefaultFile') = 'C',cDefaultFile,''))
  39.  
  40.      
  41.    /////////////////////////////Load Programs
  42.  
  43.    set proc to program(1)  // Load this one to support included class
  44.    set proc to RptToRep.wfm addi
  45.    set proc to RptToRepRsc.cc addi
  46.    set proc to RptToRepConv.cc addi
  47.    set proc to qParse.cc addi
  48.  
  49.    ////////////////////////////Load Help File
  50.  
  51.    cLoadPath = substr(program(1),1,rat('\',program(1)))
  52.                          
  53.    if file(cLoadPath+'RptToRep.hlp')
  54.       set help to cLoadPath+'RptToRep.hlp'
  55.    elseif file(_dbwinhome+'help/dBASE.hlp')
  56.       set help to
  57.    endif
  58.  
  59.    /////////////////////////////Instantiate classes
  60.  
  61.    f = new RptToRepForm()
  62.  
  63.    f.Env                    = new Environment()           // Store/Restore environment
  64.    f.oLang                = new InternationalText(f)    // Internationalization
  65.    f.oQuery          = new QParse()                    // Query Parser
  66.    f.pageno                = 1
  67.  
  68.    if not empty(cDefaultFile)                // Read in default filenames
  69.                                               // if sent from Navigator
  70.  
  71.       f.SourcePathField.value := cDefaultFile   // Default Source Path
  72.                                                 //
  73.       if at('.RPT',upper(cDefaultFile)) > 0
  74.            
  75.          f.TargetPathField.value := ;
  76.            substr(cDefaultFile,1,at('.RPT',upper(cDefaultFile))-1)+;
  77.            '.REP'
  78.  
  79.       elseif at('.RPL',upper(cDefaultFile)) > 0  // Default Target Path
  80.  
  81.          f.TargetPathField.value := ;
  82.            substr(cDefaultFile,1,at('.RPL',upper(cDefaultFile))-1)+;
  83.            '.LAB'
  84.  
  85.       endif
  86.  
  87.    endif
  88.  
  89.    f.oLang.SetUpStrings()                              // Sets form text for language          
  90.  
  91.  
  92.    //////////////////////////////Open form and start Wizard
  93.    f.ReadModal()
  94.    f.release()                           // recover resources
  95.  
  96.  
  97.   ///////////////////Class Environment//////////////////////////////
  98.   /* Stores and restores environment present before running
  99.      Report Converter Wizard
  100.    
  101.      Restores environment with Reset() method call
  102.      Syntax:
  103.                       form.oEnv = New Environment()
  104.                form.oEnv.reset()
  105.    */
  106.  
  107.  
  108.    Class Environment
  109.  
  110.    this.talk         = set('TALK')        //Store states to properties
  111.    this.exact         = sET('EXACT')
  112.    this.cuaenter     = Set('CUAENTER')
  113.  
  114.    Set TALK OFF
  115.    Set EXACT OFF
  116.    Set CUAENTER ON
  117.  
  118.    ///////////////////Method Reset//////////////////////////////////
  119.    
  120.    function reset                     // Restore environment
  121.       Private cState
  122.  
  123.       cState = this.talk
  124.       Set TALK &cState
  125.  
  126.       cState = this.exact
  127.       Set EXACT &cState
  128.   
  129.       cState = this.cuaenter
  130.       Set CUAENTER &cState 
  131.  
  132.       return true
  133.  
  134.   endclass
  135.